feat: add make sbom / install-sbom / uninstall-sbom targets#258
Open
MarkAtwood wants to merge 2 commits into
Open
feat: add make sbom / install-sbom / uninstall-sbom targets#258MarkAtwood wants to merge 2 commits into
MarkAtwood wants to merge 2 commits into
Conversation
Adds CycloneDX + SPDX SBOM generation via wolfssl's gen-sbom script. Usage: make sbom WOLFSSL_DIR=/path/to/wolfssl wolfCLU is a binary (not .so); artifact hash uses --srcs from wolfssl_SOURCES. Version from CLUWOLFSSL_VERSION_STRING in version.h.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds SBOM (CycloneDX + SPDX) generation and installation/uninstallation targets to the autotools build, along with configure-time discovery of required tooling, to support compliance/evidence needs.
Changes:
- Adds
make sbom,make install-sbom,make uninstall-sbomtargets that generate SBOM artifacts and install/remove them under$(datadir)/doc/wolfclu/. - Introduces
configure.acchecks forpython3andpyspdxtoolsintended to support the SBOM generation flow.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Makefile.am | Adds SBOM targets and wiring for generation + install/uninstall. |
| configure.ac | Adds configure-time tool detection for SBOM prerequisites. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+170
to
+184
| WOLFSSL_DIR ?= | ||
| PRODUCT = wolfclu | ||
| VERSION = $(shell grep CLUWOLFSSL_VERSION_STRING $(srcdir)/wolfclu/version.h 2>/dev/null | sed 's/.*"\(.*\)".*/\1/') | ||
| GEN_SBOM = $(WOLFSSL_DIR)/scripts/gen-sbom | ||
| WOLFSSL_INCLUDEDIR ?= $(WOLFSSL_DIR)/include | ||
| SBOM_OPTS = --name $(PRODUCT) \ | ||
| --version $(VERSION) \ | ||
| --supplier "wolfSSL Inc." \ | ||
| --options-h $(WOLFSSL_INCLUDEDIR)/wolfssl/options.h \ | ||
| --srcs $(addprefix $(srcdir)/,$(wolfssl_SOURCES)) | ||
|
|
||
| SBOM_OUT_DIR = $(builddir) | ||
| SBOM_CDX = $(SBOM_OUT_DIR)/$(PRODUCT)-$(VERSION).cdx.json | ||
| SBOM_SPDX_J = $(SBOM_OUT_DIR)/$(PRODUCT)-$(VERSION).spdx.json | ||
| SBOM_SPDX_TV = $(SBOM_OUT_DIR)/$(PRODUCT)-$(VERSION).spdx |
Comment on lines
+188
to
+195
| sbom: all | ||
| @if test -z "$(WOLFSSL_DIR)"; then \ | ||
| echo "ERROR: WOLFSSL_DIR not set. Usage: make sbom WOLFSSL_DIR=/path/to/wolfssl"; \ | ||
| exit 1; \ | ||
| fi | ||
| @if test -z "$(PYTHON3)"; then echo "ERROR: python3 not found in PATH."; exit 1; fi | ||
| $(PYTHON3) $(GEN_SBOM) $(SBOM_OPTS) | ||
|
|
Comment on lines
+62
to
+65
| # SBOM generation prerequisites | ||
| AC_CHECK_PROG([PYTHON3], [python3], [python3]) | ||
| AC_CHECK_PROG([PYSPDXTOOLS], [pyspdxtools], [pyspdxtools]) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
make sbom,make install-sbom, andmake uninstall-sbomtargets to wolfCLU's autotools build for EU CRA compliance evidence (CycloneDX 1.6 + SPDX 2.3 output)AC_CHECK_PROGchecks forpython3andpyspdxtoolsinconfigure.acUsage
WOLFSSL_DIRmust point to a wolfssl checkout containingscripts/gen-sbom(branchfeat/sbom-embedded, ormasteronce wolfSSL/wolfssl#10343 merges).Notes
wolfssl), not a shared library — artifact hash uses--srcs $(wolfssl_SOURCES)(the compiled.csource list) rather than--lib; no staging step neededCLUWOLFSSL_VERSION_STRINGinwolfclu/version.h(the#define VERSION 0.3inclu_header_main.his stale and ignored)WOLFSSL_INCLUDEDIRdefaults to$(WOLFSSL_DIR)/include; wolfssl'soptions.his used for the config source since wolfCLU has no generated options header of its ownuninstall-hookdependency ensuresmake uninstallremoves SBOM files